package com.web.hawaste.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.web.hawaste.entity.SysUser;
import com.web.hawaste.mapper.SysUserMapper;
import com.web.hawaste.service.ISysUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用户表 服务实现类
 * </p>
 *
 * @author Suzy
 * @since 2022-09-26
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {

    @Override
    public List<SysUser> selectByRid(long rid) {
        return baseMapper.selectByRid(rid);
    }

    @Override
    public List<SysUser> selectNoRole(long rid, long oid) {
        return baseMapper.selectNoRole(rid, oid);
    }

    @Override
    public SysUser findUserByUsername(String username) {
        QueryWrapper<SysUser> query = new QueryWrapper();
        query.eq("username", username);
        return baseMapper.selectOne(query);
    }
}
